#ifndef _GUI_VALUEEDITWND_H
#define _GUI_VALUEEDITWND_H

#include <QDialog>

class QComboBox;
class QPushButton;
class QHBoxLayout;
class QVBoxLayout;
class TouchSpinBox;
class TouchDoubleSpinBox;
class SysController;

class ValueEditWnd : public QDialog {
	Q_OBJECT

public:
	ValueEditWnd(int item_index, bool bias, QWidget *parent = 0);
//	ValueEditWnd(int value_type, QWidget *parent = 0);
	~ValueEditWnd();

private slots:
	void dialogShouldReturn();	
	void onRangeChanged(const QString &rng_str);

private:
	void InitWidgets();
	void RefreshSpinBox();

	QComboBox *rangeCombo;
	TouchSpinBox *spinLower;
	TouchSpinBox *spinUpper;
	TouchDoubleSpinBox *dspinLower;
	TouchDoubleSpinBox *dspinUpper;
	QHBoxLayout *headLayout;
	QHBoxLayout *spinLayout;
	QVBoxLayout *vLayout;
	QPushButton *okButton;
	QPushButton *cancelButton;

	SysController *sys_;
	int item_index_;
	bool bias_;
	QString old_rng_;
};

#endif // _GUI_VALUEEDITWND_H
